package com.future.myjavatools.core.zhoupu;

import org.apache.commons.codec.digest.DigestUtils;

public class Md5PasswordEncoder {

	public String encodePassword(String password, String code) {
		return DigestUtils.md5Hex(password + code);
	}

	public boolean isPasswordValid(String encodedPassword, String password, String code) {
		return encodedPassword.equals(encodePassword(password, code));
	}

	public boolean matchesNotSalt(String encodedInput, String encodedPassword) {
		return encodedInput.equals(encodedPassword);
	}

}
